<template>
  <view class="ss-coupon-menu-wrap ss-flex ss-col-center">
    <view
      class="menu-item ss-flex-col ss-row-center ss-col-center"
      v-for="item in props.list"
      :key="item.title"
      @tap="toPath(item)"
      :class="item.type === 'all' ? 'menu-wallet' : 'ss-flex-1'"
    >
      <image class="item-icon" :src="sheep.$url.static(item.icon)" mode="aspectFit"></image>
      <view class="menu-title ss-m-t-28">{{ item.title }}</view>
    </view>
  </view>
</template>

<script setup>
  /**
   * 装修组件 - 优惠券菜单
   */
  import sheep from '@/sheep';

  // 接收参数
  const props = defineProps({
    list: {
      type: Array,
      default() {
        return [
          /*{
            title: '优惠券',
            value: '0',
            icon: 'https://xiaozhan-shop.oss-cn-beijing.aliyuncs.com/2023/12/1057ed47dea0ed4e3aa9dbf42a7fbab852coupun.png',
            path: '/pages/coupon/backup/list',
            type: 'used',
          },*/
	        {
		        title: '我的留言',
		        value: '0',
		        icon: 'https://xiaozhan-shop.oss-cn-beijing.aliyuncs.com/2024/10/152b9ced3447044babaee47cd0e24cc1af留言.png',
		        path: '/pages/index/comment',
		        type: 'used',
	        },
          /*{
            title: '实名认证',
            value: '0',
            icon: 'https://xiaozhan-shop.oss-cn-beijing.aliyuncs.com/2024/07/09108cc688a0554f5c863b8631af0bfc84id_card.png',
            path: '/pages/app/idCard',
            type: 'used',
          },*/
        ];
      },
    },
  });

  function toPath(item) {
		sheep.$router.go(item.path)
  }
</script>

<style lang="scss" scoped>
  .ss-coupon-menu-wrap {
    .menu-item {
      height: 160rpx;
      .menu-title {
        font-size: 24rpx;
        line-height: 24rpx;
        color: #333333;
      }
      .item-icon {
        width: 44rpx;
        height: 44rpx;
      }
    }
    .menu-wallet {
      width: 144rpx;
    }
  }
</style>
